package com.example.e11_q3;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/13
 */
public class VisitorPatternTest {
    public static void main(String[] args) {
        // 1. 创建员工列表
        EmployeeList employeeList = new EmployeeList();

        // 2. 添加员工（正式员工 + 临时工）
        employeeList.addEmployee(new RegularEmployee(45, "研发部", 5000)); // 加班5小时
        employeeList.addEmployee(new RegularEmployee(35, "研发部", 5000)); // 请假5小时
        employeeList.addEmployee(new TemporaryEmployee(20, "市场部", 50));
        employeeList.addEmployee(new TemporaryEmployee(30, "市场部", 50));

        // 3. 人力资源部统计
        HRDepartmentVisitor hrVisitor = new HRDepartmentVisitor();
        employeeList.accept(hrVisitor);
        hrVisitor.showReport();

        System.out.println("\n------------------------\n");

        // 4. 财务部统计
        FinanceDepartmentVisitor financeVisitor = new FinanceDepartmentVisitor();
        employeeList.accept(financeVisitor);
        financeVisitor.showReport();
    }
}
